package com.Gameplay.Combat.Hurtbox;

import com.Gameplay.Combat.Attack.AttackType;
import com.Gameplay.Combat.Hitbox.Hitbox;

import com.Gameplay.Combat.Hitbox.impl.RectangleHitbox;
import com.Gameplay.character.Role.parentRole;

public class FistHurtbox extends RectangleHitbox {
    //人物拳攻击碰撞箱
    private double Rwidth;
    private double Lwidth;
    private double Uheight;
    private double Dheight;
    private double FistLength;

    public void setLength(AttackType attackType) {
        if (attackType == AttackType.Light) {
            FistLength = 120;
        } else if (attackType == AttackType.Middle) {
            FistLength = 140;
        } else if (attackType == AttackType.Heavy) {
            FistLength = 160;
        }
    }

    public void setFistBox(double currentX,double currentY,int facing,AttackType attackType){
        setLength(attackType);
        if (FistLength!=0&&facing==1){
            currentX+=FistLength;
            Rwidth=currentX+100;
            Lwidth=currentX-100;
            Uheight=currentY+40;
            Dheight=currentY-40;
        }
        if (FistLength!=0&&facing==0){
            currentX-=FistLength;
            Rwidth=currentX+100;
            Lwidth=currentX-100;
            Uheight=currentY+40;
            Dheight=currentY-40;

        }
    }



    @Override
    public double getRwidth() {
        return Rwidth;
    }

    @Override
    public double getLwidth() {
        return Lwidth;
    }

    @Override
    public double getUheight() {
        return Uheight;
    }

    @Override
    public double getDheight() {
        return Dheight;
    }
}
